package homework.score.system;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class MenuNode implements INode {

    private String name;
    private String description;

    private List<INode> items = new ArrayList<>();

    public MenuNode(String name, String description, INode... items) {
        this.name = name;
        this.description = description;

        Collections.addAll(this.items, items);
    }

    @Override
    public INode getNode(int i) {
        return items.get(i);
    }

    @Override
    public INode setNode(int i, INode node) {
        items.set(i, node);
        return this;
    }

    @Override
    public String getDescription() {
        return description;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public INode addNode(INode node) {
        items.add(node);
        return this;
    }

    @Override
    public int size() {
        return items.size();
    }

    @Override
    public void execute() {
        throw new UnsupportedOperationException();
    }
}
